<script type="text/javascript">
$(document).ready(function () {
	/*
	$("#form1").submit( function () {
		if($("#materials_no").val()==''){
			alert('物资编码不能为空');
			return false;		
		}
		if($("#materials_name").val()==''){
			alert('物资名称不能为空');
			return false;		
		}
		if($("#part_number").val()==''){
			alert('部件号不能为空');
			return false;		
		}
	}); 
	*/
	$("#original_number").change(function(){
		var num = parseInt($("#original_number").val());
		var price = parseFloat($("#unit_price").val());
		if(!isNaN(num) && !isNaN(price)){
			$("#total_price").val(price*num);
		}
		
	});
	$("#unit_price").change(function(){
		var num = parseInt($("#original_number").val());
		var price = parseFloat($("#unit_price").val());
		if(!isNaN(num) && !isNaN(price)){
			$("#total_price").val(price*num);
		}
		
	});
});
</script>

<h2 class="title">高额配件</h2>
<form action="index.php?c=zy_high_replacement&m={%$act%}&post=1" method=post name=frm id="form1" enctype="multipart/form-data" onSubmit="return Validator.Validate(this,3)">
<table class="tb_term" width="100%">
<tr>
	<td class="tr_td_width01 alignright">物资编码</td>
	<td class="tr_td_width03"><input type=text id="materials_no" name="materials_no" class="input_edit_stand txt-normal" size=25 value='{%$materials_no%}'  dataType="Require" msg="不能为空"></td>
	<td class="tr_td_width02 alignright">物资名称</td>
	<td><input type=text id="materials_name" name="materials_name" class="input_edit_stand txt-normal" size="25" value='{%$materials_name%}'  dataType="Require" msg="不能为空"></td>	
</tr>
<tr>
	<td class="alignright">规格型号</td>
	<td><input type=text id="format_model" name="format_model" class="input_edit_stand txt-normal" size="25" value='{%$format_model%}'></td>
	<td class="alignright">供应商</td>
	<td><input type=text name="suppliers_name" class="input_edit_stand txt-normal" size="25" value='{%$suppliers_name%}'></td>
</tr>
<tr>
	<td class="alignright">原始数量</td>
	<td><input type=text name="original_number" id="original_number" class="input_edit_num txt-normal" size="25" value='{%$original_number%}'  dataType="Require" msg="不能为空"></td>
	<td class="alignright">部件号</td>
	<td><input type=text id="part_number" name="part_number" class="input_edit_stand txt-normal" size="25" value='{%$part_number%}'></td>	
</tr>
<tr>
	<td class="alignright">单价</td>
	<td><input type=text name="unit_price" id="unit_price" class="input_edit_num txt-normal" size="20" value='{%$unit_price%}'><label class="label01">万元</label></td>
	<td class="alignright">总价</td>
	<td><input type=text name="total_price" id="total_price" class="input_edit_num txt-normal" size="20" value='{%$total_price%}'><label class="label01">万元</label></td>	
</tr>
<tr>
	<td class="alignright">币种</td>
	<td>
		<select name="currency" class="select_edit txt-normal">
			{%html_options options=$price_type_arr selected=$currency %}
		</select>
	</td>
	<td class="alignright">存储位置</td>
	<td><input type=text name="location" class="input_edit_stand txt-normal" value='{%$location%}'></td>
</tr>
</table>
<p class="btn_right">
	<input type=hidden name='high_replacement_id' id='high_replacement_id' value='{%$high_replacement_id%}'>
	<button type="submit" class="b-default" hidefocus="true"><span><em>提交</em></span></button>
	<button type="button" class="b-default" hidefocus="true" onclick="history.go(-1)"><span><em>返回</em></span></button>
</p>
</form>